package com.senior.singleton;

/**
 * 静态内部类的单例模式
 */
public class SingletonDemo01 {

    private SingletonDemo01 (){}

    private static class SingletonInstance{
        private static final SingletonDemo01 SINGLETON = new SingletonDemo01();

        public static SingletonDemo01 getSingleton(){
            return SingletonInstance.SINGLETON;
        }
    }

    public static void main(String[] args) {
        SingletonDemo01 singleton = SingletonInstance.getSingleton();
    }

}
